#@head("新增/编辑菜单")
#define main()
	<link rel="stylesheet" href="#(ctx)/assets/layuiadmin/style/form.css" media="all">
#end
<body>
	<div class="layui-form layui-form-pane" lay-filter="layuiadmin-form-system">
	    <div class="layui-row layui-col-space1 task-row">
	 		<div class="layui-col-xs12">
				<div class="layui-form-item">
					<label class="layui-form-label">上级菜单</label>
					<div class="layui-input-block">
						<select name="model.parent_id" lay-verify="required">
							<option value="0" #(model.type?? == 0 ? 'selected' : '')>根目录</option>
				        	#(parentSelect)
						</select>
					</div>
				</div>
			</div>
		</div>
	    <div class="layui-row layui-col-space1 task-row">
	 		<div class="layui-col-xs12">
				<div class="layui-form-item">
					<label class="layui-form-label">图标</label>
					<div class="layui-input-block">
						<input type="text" id="iconPicker" lay-filter="iconPicker" class="layui-input">
					</div>
				</div>
			</div>
		</div>
	    <div class="layui-row layui-col-space1 task-row">
	 		<div class="layui-col-xs12">
				<div class="layui-form-item">
					<label class="layui-form-label">名称</label>
					<div class="layui-input-block">
						<input type="text" name="model.name" value="#(model.name??)" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
					</div>
				</div>
			</div>
		</div>
	    <div class="layui-row layui-col-space1 task-row">
	 		<div class="layui-col-xs12">
				<div class="layui-form-item">
					<label class="layui-form-label">链接地址</label>
					<div class="layui-input-block">
						<input type="text" name="model.url" value="#(model.url??)" placeholder="请输入" autocomplete="off" class="layui-input">
					</div>
				</div>
			</div>
		</div>
	    <div class="layui-row layui-col-space1 task-row">
	 		<div class="layui-col-xs12">
				<div class="layui-form-item">
					<label class="layui-form-label">状态</label>
					<div class="layui-input-block">
						<input type="radio" name="model.status" value="1" title="显示" #(model.status?? == 1 ? 'checked' : '')>
						<input type="radio" name="model.status" value="2" title="隐藏" #(model.status?? == 2 ? 'checked' : '')>
					</div>
				</div>
			</div>
		</div>
	    <div class="layui-row layui-col-space1 task-row">
	 		<div class="layui-col-xs12">
				<div class="layui-form-item">
					<label class="layui-form-label">类型</label>
					<div class="layui-input-block">
						<select name="model.type" lay-verify="required">
							<option value=""></option>
							<option value="1" #(model.type?? == 1 ? 'selected' : '')>根目录</option>
							<option value="2" #(model.type?? == 2 ? 'selected' : '')>a标签</option>
							<option value="3" #(model.type?? == 3 ? 'selected' : '')>a标签_blank</option>
							<option value="4" #(model.type?? == 4 ? 'selected' : '')>外部url</option>
						</select>
					</div>
				</div>
			</div>
		</div>
	    <div class="layui-row layui-col-space1 task-row">
	 		<div class="layui-col-xs12">
				<div class="layui-form-item">
					<label class="layui-form-label">排序</label>
					<div class="layui-input-block">
						<input type="text" name="model.sort" value="#(model.sort??)" lay-verify="required|number" placeholder="请输入" autocomplete="off" class="layui-input">
					</div>
				</div>
			</div>
		</div>
		<input type="hidden" name="model.id" value="#(model.id??)"/>
		<div class="layui-form-item layui-hide">
			<input type="button" lay-submit lay-filter="LAY-menu-front-submit" id="LAY-menu-front-submit" value="确认">
		</div>
	</div>
	#@layui()
	#define use()
		use(["index", "form", "iconPicker"], function(){
			var $ = layui.$,
			form = layui.form,
			iconPicker = layui.iconPicker;
			
			iconPicker.render({
                // 选择器，推荐使用input
                elem: '#iconPicker',
                // 数据类型：fontClass/unicode，推荐使用fontClass
                type: 'fontClass',
                // 是否开启搜索：true/false
                search: false,
                // 是否开启分页
                page: true,
                // 点击回调
                click: function (data) {
                    console.log(data);
                }
            });
            //选中图标
            iconPicker.checkIcon("iconPicker", "#(model.icon??)");
		})
	#end
</body>
</html>